package com.wsl.MD5;

import org.springframework.util.DigestUtils;

import java.io.UnsupportedEncodingException;

/**
 * @Author: wsl
 * @Date: 2022/3/28 10:15
 */
public class MD5Utils {

    private static final String text = "blog2.0";

    /*密码加密*/
    public static String md5(String pwd,String salt) throws UnsupportedEncodingException {
        String pwdTextSalt = pwd+text+salt;
        return DigestUtils.md5DigestAsHex(pwdTextSalt.getBytes("UTF-8"));
    }


}